<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSnapshotTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('snapshot', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('type',10)->default('mb')->comment('fil');
            $table->string('note',255)->nullable();
            $table->timestamp('time')->default(DB::raw('CURRENT_TIMESTAMP'));
            $table->integer('order_id')->nullable();
            $table->string('wallet')->nullable()->comment('钱包地址');
            $table->string('bank_name',50)->default(0)->comment('银行名称');
            $table->string('bank_account',50)->default(0)->comment('银行账号');
            $table->string('bank_legal',50)->default(0)->comment('用户姓名');
            $table->engine = 'InnoDB';
            $table->charset = 'utf8';
            $table->collation = 'utf8_unicode_ci';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('snapshot');
    }
}
